#!/bin/sh
# This regression test is a part of SIPp.
# The warning for an unexpected CANCEL a call goes on after reads as the
# one for a BYE does: "Continuing call on an unexpected CANCEL".
. "`dirname "$0"`/../functions"; init

sippfg -sf uas.xml -i 127.0.0.1 -p 27370 -m 1 -timeout 4 \
    -default_behaviors all,-abortunexp -trace_err -error_file err.log \
    >/dev/null 2>&1 &
uas=$!
sleep 1
sippfg -sf uac.xml -i 127.0.0.1 -p 27371 -m 1 127.0.0.1:27370 \
    -timeout 4 >/dev/null 2>&1
wait $uas
found=`grep -c 'Continuing call on an unexpected CANCEL for call: ' err.log`
rm -f err.log

if test "$found" != 1; then
    fail "no \"Continuing call on an unexpected CANCEL\" warning"
else
    ok
fi
